Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Aug 1, 2025


PR-Codex overview

This PR introduces support for supportedTokens across multiple components in the Bridge module, enhancing the functionality of payment methods and token selection.

Detailed summary

  • Added supportedTokens prop to CheckoutWidget, BuyWidget, and TransactionWidget.
  • Updated BridgeOrchestrator to accept and utilize supportedTokens.
  • Enhanced PaymentSelection to support supportedTokens.
  • Modified usePaymentMethods to filter quotes based on supportedTokens.
  • Updated TokenSelector to implement a search feature and use SelectWithSearch.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Added support for specifying a list of supported tokens when selecting payment methods in bridge-related widgets.
    • Payment method options are now filtered to show only those matching the supported tokens, if provided.
  • Enhancements

    • Bridge, Buy, Checkout, and Transaction widgets now accept and utilize a supported tokens list for improved customization.
    • Token selector component updated with enhanced search functionality and simplified user interface.

@gregfromstl gregfromstl requested review from a team as code owners August 1, 2025 18:52
@linear
Copy link

linear bot commented Aug 1, 2025

@changeset-bot
Copy link

changeset-bot bot commented Aug 1, 2025

⚠️ No Changeset found

Latest commit: 44389ae

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 7:42pm
nebula ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 7:42pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 7:42pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 7:42pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 7:42pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 1, 2025

Walkthrough

The changes introduce support for an optional supportedTokens parameter across several components and hooks related to payment and bridge functionality. This parameter is propagated from UI widgets through orchestrator and selection components down to the core usePaymentMethods hook, which now filters payment method quotes based on the provided supported tokens. Additionally, the TokenSelector component was refactored to use a new SelectWithSearch component with enhanced search and rendering capabilities.

Changes

Cohort / File(s) Change Summary
Core Hook: Payment Methods Filtering
packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
The usePaymentMethods hook now accepts an optional supportedTokens parameter and filters payment method quotes to include only those matching the specified tokens. The original behavior is preserved if supportedTokens is not provided.
Bridge Orchestrator Propagation
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
The BridgeOrchestrator component and its props interface now accept an optional supportedTokens property, which is passed to the PaymentSelection component.
Widget Propagation
packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx, packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx, packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
The BuyWidget, CheckoutWidget, and TransactionWidget components now pass the supportedTokens prop to the BridgeOrchestrator component, enabling downstream filtering.
Payment Selection Propagation
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
The PaymentSelection component and its props interface now accept an optional supportedTokens property, which is then passed to the usePaymentMethods hook for filtering.
TokenSelector Refactor
apps/playground-web/src/components/ui/TokenSelector.tsx
The TokenSelector component was refactored to replace the custom Select and its subcomponents with a new SelectWithSearch component. It introduces a new options array, a custom search function, and a new render callback for token options, simplifying the JSX and enhancing search capabilities without changing the component's external API.

Sequence Diagram(s)

sequenceDiagram
    participant Widget (Buy/Checkout/Transaction)
    participant BridgeOrchestrator
    participant PaymentSelection
    participant usePaymentMethods

    Widget->>BridgeOrchestrator: Render with supportedTokens
    BridgeOrchestrator->>PaymentSelection: Pass supportedTokens prop
    PaymentSelection->>usePaymentMethods: Call with supportedTokens
    usePaymentMethods-->>PaymentSelection: Return filtered payment methods
    PaymentSelection-->>BridgeOrchestrator: Render filtered options
    BridgeOrchestrator-->>Widget: Render updated UI
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20d9b94 and 44389ae.

📒 Files selected for processing (7)
  • apps/playground-web/src/components/ui/TokenSelector.tsx (4 hunks)
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts (4 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx (4 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

Files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
apps/{dashboard,playground-web}/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

apps/{dashboard,playground-web}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/* (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Use NavLink for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Use cn() from @/lib/utils for conditional class logic
Use design system tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components (Node edge): Start files with import "server-only";
Client Components (browser): Begin files with 'use client';
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header – never embed tokens in URLs
Return typed results (e.g., Project[], User[]) – avoid any
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys for React Query cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-js in server components

Files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use design system tokens (e.g., `bg-card`, `border-border`, `text-muted-foreground`)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : prefer composable primitives over custom markup: `button`, `in...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: `Button`, `Input`, `Select`, `Tabs`, `Card`, `Sidebar`, `Separator`, `Badge`.

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : use design system tokens (e.g., `bg-card`...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use design system tokens (e.g., `bg-card`, `border-border`, `text-muted-foreground`)

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : import ui primitives from `@/components/u...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to **/*.{ts,tsx} : choose composition over inheritance; leverage utility types (`partial`, `...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Choose composition over inheritance; leverage utility types (`Partial`, `Pick`, etc.)

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : stick to design-tokens: background (`bg-card`), borders (`bord...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Stick to design-tokens: background (`bg-card`), borders (`border-border`), muted text (`text-muted-foreground`) etc.

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to dashboard/**/*client.tsx : interactive ui that relies on hooks (`usestate`, `useeffect`, ...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: the thirdwebbarchart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(side...
Learnt from: arcoraven
PR: thirdweb-dev/js#7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to src/exports/react.native.ts : react native specific exports are in `src/exports/react.nat...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/exports/react.native.ts : React Native specific exports are in `src/exports/react.native.ts`

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{tsx} : expose `classname` prop on root element of c...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx} : Expose `className` prop on root element of components for overrides

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: in the erc20 public pages token price data hook (`usetokenpricedata.ts`), direct array access on `js...
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (`useTokenPriceData.ts`), direct array access on `json.data[0]` without optional chaining is intentionally correct and should not be changed to use safety checks.

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to dashboard/**/*client.tsx : anything that consumes hooks from `@tanstack/react-query` or t...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from `@tanstack/react-query` or thirdweb SDKs.

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : reuse core ui primitives; avoid re-implementing buttons, cards...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : always import from the central ui library under `@/components/...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under `@/components/ui/*` – e.g. `import { Button } from "@/components/ui/button"`.

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: in the thirdweb/js project, the react namespace is available for type annotations (like react.fc) wi...
Learnt from: MananTank
PR: thirdweb-dev/js#7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
📚 Learning: the modulecarduiprops interface already includes a client prop of type thirdwebclient, so when compo...
Learnt from: MananTank
PR: thirdweb-dev/js#7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use `Omit<ModuleCardUIProps, "children" | "updateButton">`, they inherit the client prop without needing to add it explicitly.

Applied to files:

  • apps/playground-web/src/components/ui/TokenSelector.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Build Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
apps/playground-web/src/components/ui/TokenSelector.tsx (5)

13-13: LGTM! Appropriate use of UI primitive.

The import of SelectWithSearch follows the project's convention of importing UI primitives from @/components/ui/*.


82-88: Well-structured options mapping.

The options array is correctly memoized and uses a composite key format that ensures uniqueness across chains.


93-108: Comprehensive search implementation.

The search function effectively covers all relevant token fields (symbol, name, address) with case-insensitive matching and proper error handling.


110-148: Clean adaptation to new component API.

The render function correctly adapts to the new option format while maintaining the original UI design. Good use of design system tokens and defensive programming with appropriate fallbacks.


151-173: Successful migration to SelectWithSearch.

The component correctly implements all required props for SelectWithSearch while preserving the original functionality. The loading state handling and token lookup logic are properly maintained.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch greg/mny-81-fix-issue-with-unsupportedtokens-prop-in-new-endpoint

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Aug 1, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 1, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx (1)

94-94: Add JSDoc documentation for the new prop.

The supportedTokens prop lacks documentation while all other props have comprehensive JSDoc comments.

+  /**
+   * Optional list of supported tokens to filter payment methods
+   */
   supportedTokens?: SupportedTokens;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1ad7da and 43f2f97.

📒 Files selected for processing (6)
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts (3 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx (4 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
🧠 Learnings (19)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)
Learnt from: MananTank
PR: thirdweb-dev/js#7307
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:324-346
Timestamp: 2025-06-09T15:15:02.350Z
Learning: In the move-funds functionality, MananTank prefers having both individual toast.promise notifications for each token transfer AND batch summary toasts, even though this creates multiple notifications. This dual notification approach is acceptable for the move-funds user experience.
📚 Learning: the modulecarduiprops interface already includes a client prop of type thirdwebclient, so when compo...
Learnt from: MananTank
PR: thirdweb-dev/js#7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use `Omit<ModuleCardUIProps, "children" | "updateButton">`, they inherit the client prop without needing to add it explicitly.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
📚 Learning: applies to packages/thirdweb/src/wallets/** : eip-1193, eip-5792, eip-7702 standard support in walle...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
📚 Learning: the thirdwebbarchart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(side...
Learnt from: arcoraven
PR: thirdweb-dev/js#7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : use design system tokens (e.g., `bg-card`...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use design system tokens (e.g., `bg-card`, `border-border`, `text-muted-foreground`)

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
📚 Learning: applies to dashboard/**/*client.tsx : interactive ui that relies on hooks (`usestate`, `useeffect`, ...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
📚 Learning: applies to packages/thirdweb/src/wallets/** : support for in-app wallets (social/email login)...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
📚 Learning: applies to test/src/test-wallets.ts : predefined test accounts are in `test/src/test-wallets.ts`...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in `test/src/test-wallets.ts`

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : reuse core ui primitives; avoid re-implementing buttons, cards...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : stick to design-tokens: background (`bg-card`), borders (`bord...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Stick to design-tokens: background (`bg-card`), borders (`border-border`), muted text (`text-muted-foreground`) etc.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
📚 Learning: applies to src/exports/react.native.ts : react native specific exports are in `src/exports/react.nat...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/exports/react.native.ts : React Native specific exports are in `src/exports/react.native.ts`

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
📚 Learning: applies to dashboard/**/*client.tsx : anything that consumes hooks from `@tanstack/react-query` or t...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from `@tanstack/react-query` or thirdweb SDKs.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : import ui primitives from `@/components/u...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
📚 Learning: in the onramp webhook schema (`packages/thirdweb/src/bridge/webhook.ts`), the `currencyamount` field...
Learnt from: gregfromstl
PR: thirdweb-dev/js#7450
File: packages/thirdweb/src/bridge/Webhook.ts:57-81
Timestamp: 2025-06-26T19:46:04.024Z
Learning: In the onramp webhook schema (`packages/thirdweb/src/bridge/Webhook.ts`), the `currencyAmount` field is intentionally typed as `z.number()` while other amount fields use `z.string()` because `currencyAmount` represents fiat currency amounts in decimals (like $10.50), whereas other amount fields represent token amounts in wei (very large integers that benefit from bigint representation). The different naming convention (`currencyAmount` vs `amount`) reflects this intentional distinction.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
📚 Learning: the `projectmeta` prop is not required for the server-rendered `contracttokenspage` component in the...
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The `projectMeta` prop is not required for the server-rendered `ContractTokensPage` component in the tokens shared page, unlike some other shared pages where it's needed for consistency.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
📚 Learning: in the erc20 public pages token price data hook (`usetokenpricedata.ts`), direct array access on `js...
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (`useTokenPriceData.ts`), direct array access on `json.data[0]` without optional chaining is intentionally correct and should not be changed to use safety checks.

Applied to files:

  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
📚 Learning: applies to packages/thirdweb/src/wallets/** : unified `wallet` and `account` interfaces in wallet ar...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Unified `Wallet` and `Account` interfaces in wallet architecture

Applied to files:

  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
📚 Learning: applies to packages/thirdweb/src/wallets/** : smart wallets with account abstraction...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Smart wallets with account abstraction

Applied to files:

  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : keep tokens secret via internal api route...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Keep tokens secret via internal API routes or server actions

Applied to files:

  • packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Unit Tests
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (13)
packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx (1)

372-372: LGTM - Clean prop propagation.

The addition of supportedTokens={props.supportedTokens} correctly passes the supported tokens configuration to the BridgeOrchestrator component, enabling token filtering in the payment flow.

packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx (1)

412-412: LGTM - Consistent prop propagation.

The addition of supportedTokens={props.supportedTokens} maintains consistency with other widget components and correctly forwards the token filtering configuration to BridgeOrchestrator.

packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx (1)

401-401: LGTM - Consistent implementation across widgets.

The addition of supportedTokens={props.supportedTokens} follows the same pattern as other widget components, ensuring consistent behavior across the payment widget ecosystem.

packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx (4)

20-20: LGTM - Proper type import.

The import of SupportedTokens type is correctly added to support the new functionality.


132-132: LGTM - Well-typed interface extension.

The optional supportedTokens property is properly typed and documented, following TypeScript best practices.


149-149: LGTM - Clean parameter destructuring.

The supportedTokens parameter is correctly added to the destructured parameters, maintaining consistency with the interface.


319-319: LGTM - Proper prop forwarding.

The supportedTokens prop is correctly passed to the PaymentSelection component, completing the prop chain from widgets to the core payment logic.

packages/thirdweb/src/react/core/hooks/usePaymentMethods.ts (3)

11-11: LGTM - Proper type import.

The import of SupportedTokens type is correctly added to support the filtering functionality.


37-37: LGTM - Well-typed parameter addition.

The optional supportedTokens parameter is properly typed and maintains backward compatibility.


45-45: LGTM - Clean parameter destructuring.

The supportedTokens parameter is correctly destructured for use in the hook logic.

packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx (3)

16-16: LGTM! Clean type import.

The import for SupportedTokens type follows the established import pattern and correctly references the core utilities.


115-115: LGTM! Proper parameter destructuring.

The supportedTokens parameter is correctly added to the destructuring assignment and maintains consistency with the props interface.


156-156: LGTM! Correct prop propagation to hook.

The supportedTokens parameter is properly passed to the usePaymentMethods hook, enabling the filtering functionality described in the PR objectives.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.15 KB (0%) 1.3 s (0%) 416 ms (+46.9% 🔺) 1.7 s
thirdweb (cjs) 353.02 KB (0%) 7.1 s (0%) 2.2 s (+2.03% 🔺) 9.3 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 85 ms (+360.56% 🔺) 199 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 30 ms (+404.44% 🔺) 40 ms
thirdweb/react (minimal + tree-shaking) 19.3 KB (0%) 386 ms (0%) 74 ms (+81.86% 🔺) 460 ms

@codecov
Copy link

codecov bot commented Aug 1, 2025

Codecov Report

❌ Patch coverage is 0% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.34%. Comparing base (e1ad7da) to head (44389ae).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...thirdweb/src/react/core/hooks/usePaymentMethods.ts 0.00% 22 Missing ⚠️
...web/src/react/web/ui/Bridge/BridgeOrchestrator.tsx 0.00% 2 Missing ⚠️
...b/ui/Bridge/payment-selection/PaymentSelection.tsx 0.00% 2 Missing ⚠️
...ges/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx 0.00% 1 Missing ⚠️
...hirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx 0.00% 1 Missing ⚠️
...dweb/src/react/web/ui/Bridge/TransactionWidget.tsx 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7780      +/-   ##
==========================================
- Coverage   56.37%   56.34%   -0.04%     
==========================================
  Files         905      905              
  Lines       58760    58788      +28     
  Branches     4145     4142       -3     
==========================================
- Hits        33128    33122       -6     
- Misses      25527    25561      +34     
  Partials      105      105              
Flag Coverage Δ
packages 56.34% <0.00%> (-0.04%) ⬇️
Files with missing lines Coverage Δ
...ges/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx 9.27% <0.00%> (-0.07%) ⬇️
...hirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx 11.57% <0.00%> (-0.10%) ⬇️
...dweb/src/react/web/ui/Bridge/TransactionWidget.tsx 13.15% <0.00%> (-0.09%) ⬇️
...web/src/react/web/ui/Bridge/BridgeOrchestrator.tsx 7.08% <0.00%> (-0.06%) ⬇️
...b/ui/Bridge/payment-selection/PaymentSelection.tsx 7.65% <0.00%> (-0.08%) ⬇️
...thirdweb/src/react/core/hooks/usePaymentMethods.ts 5.51% <0.00%> (-1.10%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gregfromstl gregfromstl merged commit 7617cc8 into main Aug 1, 2025
23 of 24 checks passed
@gregfromstl gregfromstl deleted the greg/mny-81-fix-issue-with-unsupportedtokens-prop-in-new-endpoint branch August 1, 2025 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages Playground Changes involving the Playground codebase. SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants